/**
 * $Revision: 1.0 $
 * $Author: Geln Yang $
 * $Date: Aug 4, 2010 9:36:35 PM $
 *
 * Author: Geln Yang
 * Date  : Aug 4, 2010 9:36:35 PM
 *
 */
package com.gooex.web.action.common;

import org.c4j.string.StringTools;
import org.c4j.system.web.Constants;

import com.gooex.domain.common.Region;
import com.gooex.service.common.IRegionManager;
import com.gooex.web.action.BaseAnonymousAction;


/**
 * @author Geln Yang
 * @version 1.0
 */
public class SetRegionAction extends BaseAnonymousAction {

	private IRegionManager regionManager;

	private String regionId;

	public String setRegion() throws Exception {
		if (StringTools.isBlankOrNull(regionId))
			return INPUT;
		Region region = regionManager.getRegion(regionId);
		if (region != null)
			sessionContext.setSession(Constants.USER_REGION, regionId);
		return SUCCESS;
	}

	public String getRegionId() {
		return regionId;
	}

	public void setRegionId(String regionId) {
		this.regionId = regionId;
	}

	public void setRegionManager(IRegionManager regionManager) {
		this.regionManager = regionManager;
	}
}
